document.addEventListener('DOMContentLoaded', function() {
  var navLinks = document.querySelectorAll('#navbar a');
  var contentSections = document.querySelectorAll('#content div');
 
  navLinks.forEach(function(link) {
    link.addEventListener('click', function(e) {
      e.preventDefault();
      var sectionId = link.getAttribute('href').slice(1);
 
      contentSections.forEach(function(section) {
        section.style.display = section.id === sectionId ? 'block' : 'none';
      });
    });
  });
});